Repository navigation
Reuse IntersectionObserver target ancestry (#60311) - #60311
Open
rubennorte wants to merge 1 commit into
Open
rubennorte wants to merge 1 commit into
rubennorte wants to merge 1 commit into
Conversation
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D134250309. |
javache
approved these changes
Nov 26, 2026
javache
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Explicit-root intersection updates resolve target-to-root ancestry even after resolving the target-to-surface path. This repeats allocations, parent-family locking, and sibling searches. Implicit roots also copy an ancestor list that can be reused directly. ## Changes Derive the explicit-root path from the already resolved target ancestry after verifying root membership, and pass the existing list directly for implicit roots. Preserve clipping and detached/non-ancestor behavior. Add a public root-membership integration case and evaluate deep implicit/explicit roots using the shared benchmark-only baseline; this diff adds no benchmark code. ## Benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, same CPU affinity. The benchmark-only baseline and final stack use the same base containing landed scrollMargin support. Values are median CPU time per complete invocation from the current runs; setup/assertions are outside timed work, and scaling cases have 100 measured invocations. These are workload-specific measurements, not isolated profiler timings or app-wide speedups. | Benchmark | Baseline CPU | Current CPU | CPU reduction | | --- | --- | --- | --- | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | 38.851 ms | -2.2% (within noise) | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | 40.505 ms | 12.5% | The ancestry cases use one threshold and emit no callbacks during timed updates. Times include mounting; the small implicit-root difference is within run-to-run variation. Clipping and scrollMargin semantics are unchanged. Changelog: [General][Changed] - Reduce IntersectionObserver ancestor traversal overhead Reviewed By: javache Differential Revision: D134250309
rubennorte
force-pushed
the
export-D134250309
branch
from
November 26, 2026 14:30
0f988c4 to
e9b28a8
Compare
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Explicit-root intersection updates resolve target-to-root ancestry even after resolving the target-to-surface path. This repeats allocations, parent-family locking, and sibling searches. Implicit roots also copy an ancestor list that can be reused directly. ## Changes Derive the explicit-root path from the already resolved target ancestry after verifying root membership, and pass the existing list directly for implicit roots. Preserve clipping and detached/non-ancestor behavior. Add a public root-membership integration case and evaluate deep implicit/explicit roots using the shared benchmark-only baseline; this diff adds no benchmark code. ## Benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, same CPU affinity. The benchmark-only baseline and final stack use the same base containing landed scrollMargin support. Values are median CPU time per complete invocation from the current runs; setup/assertions are outside timed work, and scaling cases have 100 measured invocations. These are workload-specific measurements, not isolated profiler timings or app-wide speedups. | Benchmark | Baseline CPU | Current CPU | CPU reduction | | --- | --- | --- | --- | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | 38.851 ms | -2.2% (within noise) | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | 40.505 ms | 12.5% | The ancestry cases use one threshold and emit no callbacks during timed updates. Times include mounting; the small implicit-root difference is within run-to-run variation. Clipping and scrollMargin semantics are unchanged. Changelog: [General][Changed] - Reduce IntersectionObserver ancestor traversal overhead Reviewed By: javache Differential Revision: D134250309
rubennorte
force-pushed
the
export-D134250309
branch
from
November 26, 2026 18:13
e9b28a8 to
8089727
Compare
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Explicit-root intersection updates resolve target-to-root ancestry even after resolving the target-to-surface path. This repeats allocations, parent-family locking, and sibling searches. Implicit roots also copy an ancestor list that can be reused directly. ## Changes Derive the explicit-root path from the already resolved target ancestry after verifying root membership, and pass the existing list directly for implicit roots. Preserve clipping and detached/non-ancestor behavior. Add a public root-membership integration case and evaluate deep implicit/explicit roots using the shared benchmark-only baseline; this diff adds no benchmark code. ## Benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, same CPU affinity. The benchmark-only baseline and final stack use the same base containing landed scrollMargin support. Values are median CPU time per complete invocation from the current runs; setup/assertions are outside timed work, and scaling cases have 100 measured invocations. These are workload-specific measurements, not isolated profiler timings or app-wide speedups. | Benchmark | Baseline CPU | Current CPU | CPU reduction | | --- | --- | --- | --- | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | 38.851 ms | -2.2% (within noise) | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | 40.505 ms | 12.5% | The ancestry cases use one threshold and emit no callbacks during timed updates. Times include mounting; the small implicit-root difference is within run-to-run variation. Clipping and scrollMargin semantics are unchanged. Changelog: [General][Changed] - Reduce IntersectionObserver ancestor traversal overhead Reviewed By: javache Differential Revision: D134250309
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Nov 26, 2026
Summary: ## Context Explicit-root intersection updates resolve target-to-root ancestry even after resolving the target-to-surface path. This repeats allocations, parent-family locking, and sibling searches. Implicit roots also copy an ancestor list that can be reused directly. ## Changes Derive the explicit-root path from the already resolved target ancestry after verifying root membership, and pass the existing list directly for implicit roots. Preserve clipping and detached/non-ancestor behavior. Add a public root-membership integration case and evaluate deep implicit/explicit roots using the shared benchmark-only baseline; this diff adds no benchmark code. ## Benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, same CPU affinity. The benchmark-only baseline and final stack use the same base containing landed scrollMargin support. Values are median CPU time per complete invocation from the current runs; setup/assertions are outside timed work, and scaling cases have 100 measured invocations. These are workload-specific measurements, not isolated profiler timings or app-wide speedups. | Benchmark | Baseline CPU | Current CPU | CPU reduction | | --- | --- | --- | --- | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | 38.851 ms | -2.2% (within noise) | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | 40.505 ms | 12.5% | The ancestry cases use one threshold and emit no callbacks during timed updates. Times include mounting; the small implicit-root difference is within run-to-run variation. Clipping and scrollMargin semantics are unchanged. Changelog: [General][Changed] - Reduce IntersectionObserver ancestor traversal overhead Reviewed By: javache Differential Revision: D134250309
rubennorte
force-pushed
the
export-D134250309
branch
from
November 26, 2026 18:39
8089727 to
08e98fe
Compare
Summary: ## Context Explicit-root intersection updates resolve target-to-root ancestry even after resolving the target-to-surface path. This repeats allocations, parent-family locking, and sibling searches. Implicit roots also copy an ancestor list that can be reused directly. ## Changes Derive the explicit-root path from the already resolved target ancestry after verifying root membership, and pass the existing list directly for implicit roots. Preserve clipping and detached/non-ancestor behavior. Add a public root-membership integration case and evaluate deep implicit/explicit roots using the shared benchmark-only baseline; this diff adds no benchmark code. ## Benchmark results Optimized Fantom (native + Hermes bytecode), headless Linux, same CPU affinity. The benchmark-only baseline and final stack use the same base containing landed scrollMargin support. Values are median CPU time per complete invocation from the current runs; setup/assertions are outside timed work, and scaling cases have 100 measured invocations. These are workload-specific measurements, not isolated profiler timings or app-wide speedups. | Benchmark | Baseline CPU | Current CPU | CPU reduction | | --- | --- | --- | --- | | `Scroll 100 targets, depth 40, 1 thresholds, implicit root` | 38.032 ms | 38.851 ms | -2.2% (within noise) | | `Scroll 100 targets, depth 40, 1 thresholds, explicit root` | 46.293 ms | 40.505 ms | 12.5% | The ancestry cases use one threshold and emit no callbacks during timed updates. Times include mounting; the small implicit-root difference is within run-to-run variation. Clipping and scrollMargin semantics are unchanged. Changelog: [General][Changed] - Reduce IntersectionObserver ancestor traversal overhead Reviewed By: javache Differential Revision: D134250309
rubennorte
force-pushed
the
export-D134250309
branch
from
November 26, 2026 18:48
08e98fe to
595b5d4
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Context
Explicit-root intersection updates resolve target-to-root ancestry even after resolving the target-to-surface path. This repeats allocations, parent-family locking, and sibling searches. Implicit roots also copy an ancestor list that can be reused directly.
Changes
Derive the explicit-root path from the already resolved target ancestry after verifying root membership, and pass the existing list directly for implicit roots. Preserve clipping and detached/non-ancestor behavior. Add a public root-membership integration case and evaluate deep implicit/explicit roots using the shared benchmark-only baseline; this diff adds no benchmark code.
Benchmark results
Optimized Fantom (native + Hermes bytecode), headless Linux, same CPU affinity. The benchmark-only baseline and final stack use the same base containing landed scrollMargin support. Values are median CPU time per complete invocation from the current runs; setup/assertions are outside timed work, and scaling cases have 100 measured invocations. These are workload-specific measurements, not isolated profiler timings or app-wide speedups.
Scroll 100 targets, depth 40, 1 thresholds, implicit rootScroll 100 targets, depth 40, 1 thresholds, explicit rootThe ancestry cases use one threshold and emit no callbacks during timed updates. Times include mounting; the small implicit-root difference is within run-to-run variation. Clipping and scrollMargin semantics are unchanged.
Changelog:
[General][Changed] - Reduce IntersectionObserver ancestor traversal overhead
Reviewed By: javache
Differential Revision: D134250309